/**
 * 语法糖
 */
export default function (str:string,oneself:string,data:any){
    str.match(/{.*?}/g)?.map(e=>{
        e = e.replace(/{[ ]*|[ ]*}/g,"")
        if(e === "this") return oneself
        let a = data;
        e.split(".").filter(e=>e).forEach(e=>{a = a[e]})
        str = str.replace(/{.*?}/,a)
    })
    return str
}